<?php
$screen = Blyn::app()->getCurrentNode()->getUIManager()->getCurrentScreen();
$ajaxSubmitBtn = $screen->buildAjaxLink('messageSubmit', 'Submit',NULL, 'messageItemView2', array('update' => "#show_service_message", 'type' => 'post'), array('class' => 'btn'));
$ajaxMoreMessageBtn = $screen->buildAjaxLink('moreMessageBtn', 'More Message',NULL, 'messageItemView2', array('update' => "#show_service_message", 'type' => 'post'), array('class' => 'btn'));

$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'messageForm',
 //   'type'=>'horizontal',
    'htmlOptions' => array('class' => 'well'),
        ));

$model = new MessageFormModel();
echo $form->textFieldRow($model, 'sendTo', array('class' => 'span5'));
echo $form->textAreaRow($model, 'messageBody', array('class' => 'span5', 'rows' => 3));
?>
<div id="moreMessage"></div>
<div class="row-fluid">
    <div class="span3">
        <?php echo $ajaxSubmitBtn; ?>
    </div>   
    <div class="span5">
        <?php echo $ajaxMoreMessageBtn; ?>
    </div> 
</div>
<?php $this->endWidget(); ?>

<div id="show_service_message">
    <?php
    $screen->renderView('messageItemView2', NULL);
    ?>
</div>






